<?php
    header("Content-type:text/html;charset=utf-8");
    if ($_POST) {
        include '../../api/config.php';
        include './comm.php';
        $json = $_POST["data"];
        $data = json_decode($json);
        $id = $data->head;
        $ids = $data->id;

        if ($id == '40000') {
            if (flag($data)) {
                $file = "../../view/item/" . $ids . ".html";
                if (!unlink($file)) {
                    echo get_msg('400','数据异常~',false,false);
                } else {
                    echo get_msg('200','操作成功~',false,false);
                }
            } else {
                echo get_msg('500','权限不足~','../index.html',false);
            }
        }
        // 输出内容
        $conn = null;
    } else {
        echo "<script>\r\n    window.location.href = '../../view';\r\n    </script>";
    }